/*
 * @Date: 2024-09-04 17:10:48
 * @Author: Yu Weifeng weifeng.yu@gientech.com
 * @Description: 
 */
import { sum, mean, max, min } from 'lodash-es';
export function sheetFuncLib(funcName, params) {
  function _2num(str) {
    return isNaN(Number(str)) ? 0 : Number(str);
  }
  const map = {
    SUM(params) {
      return sum(params);
    },
    AVERAGE(params) {
      return mean(params);
    },
    MAX(params) {
      return max(params);
    },
    MIN(params) {
      return min(params);
    }
  };
  return map[funcName](params.map(p => _2num(p)));
}